#ifndef __M_LOGGER_HPP__
#define __M_LOGGER_HPP__
#include<stdio.h>
#include<time.h>

#define INF 0
#define DBG 1
#define ERR 2
#define DEFAULT_LOG_LEVEL INF 

//日志宏
#define LOG(level,format,...)do{\
    time_t t=time(NULL);\
    struct tm *lt= localtime(&t);\
    char buf[128];\
    strftime(buf,sizeof(buf),"%Y-%m-%d %H:%M:%S",lt);\
    fprintf(stdout," [%s:%s:%d] " format , buf , __FILE__ , __LINE__ , ##__VA_ARGS__);\
    fprintf(stdout,"\n");\
}while(0)

#define ILOG(format,...) LOG(INF,format,##__VA_ARGS__)
#define DLOG(format,...) LOG(DBG,format,##__VA_ARGS__)
#define ELOG(format,...) LOG(ERR,format,##__VA_ARGS__)

#endif